import 'package:mziot/app/data/device_list_entity.dart';
import 'package:mziot/generated/json/base/json_convert_content.dart';

DeviceListEntity $DeviceListEntityFromJson(Map<String, dynamic> json) {
  final DeviceListEntity deviceListEntity = DeviceListEntity();
  final List<DeviceListList>? list = jsonConvert.convertListNotNull<DeviceListList>(json['list']);
  if (list != null) {
    deviceListEntity.list = list;
  }
  final bool? hasNext = jsonConvert.convert<bool>(json['hasNext']);
  if (hasNext != null) {
    deviceListEntity.hasNext = hasNext;
  }
  return deviceListEntity;
}

Map<String, dynamic> $DeviceListEntityToJson(DeviceListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  data['hasNext'] = entity.hasNext;
  return data;
}

DeviceListList $DeviceListListFromJson(Map<String, dynamic> json) {
  final DeviceListList deviceListList = DeviceListList();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    deviceListList.id = id;
  }
  final int? deviceId = jsonConvert.convert<int>(json['deviceId']);
  if (deviceId != null) {
    deviceListList.deviceId = deviceId;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    deviceListList.userId = userId;
  }
  final String? deviceName = jsonConvert.convert<String>(json['deviceName']);
  if (deviceName != null) {
    deviceListList.deviceName = deviceName;
  }
  final String? deviceBluetooth = jsonConvert.convert<String>(json['deviceBluetooth']);
  if (deviceBluetooth != null) {
    deviceListList.deviceBluetooth = deviceBluetooth;
  }
  final String? deviceSerialnum = jsonConvert.convert<String>(json['deviceSerialnum']);
  if (deviceSerialnum != null) {
    deviceListList.deviceSerialnum = deviceSerialnum;
  }
  final String? deviceImg = jsonConvert.convert<String>(json['deviceImg']);
  if (deviceImg != null) {
    deviceListList.deviceImg = deviceImg;
  }
  final int? connectStatus = jsonConvert.convert<int>(json['connectStatus']);
  if (connectStatus != null) {
    deviceListList.connectStatus = connectStatus;
  }
  final int? deviceLightRate = jsonConvert.convert<int>(json['deviceLightRate']);
  if (deviceLightRate != null) {
    deviceListList.deviceLightRate = deviceLightRate;
  }
  final String? groupName = jsonConvert.convert<String>(json['groupName']);
  if (groupName != null) {
    deviceListList.groupName = groupName;
  }
  final bool? lockStatus = jsonConvert.convert<bool>(json['lockStatus']);
  if (lockStatus != null) {
    deviceListList.lockStatus = lockStatus;
  }
  final String? sceneName = jsonConvert.convert<String>(json['sceneName']);
  if (sceneName != null) {
    deviceListList.sceneName = sceneName;
  }
  final int? sceneLightRate = jsonConvert.convert<int>(json['sceneLightRate']);
  if (sceneLightRate != null) {
    deviceListList.sceneLightRate = sceneLightRate;
  }
  final int? groupId = jsonConvert.convert<int>(json['groupId']);
  if (groupId != null) {
    deviceListList.groupId = groupId;
  }
  final int? sceneId = jsonConvert.convert<int>(json['sceneId']);
  if (sceneId != null) {
    deviceListList.sceneId = sceneId;
  }
  final bool? isClose = jsonConvert.convert<bool>(json['isClose']);
  if (isClose != null) {
    deviceListList.isClose = isClose;
  }
  final bool? isNetDevice = jsonConvert.convert<bool>(json['isNetDevice']);
  if (isNetDevice != null) {
    deviceListList.isNetDevice = isNetDevice;
  }
  return deviceListList;
}

Map<String, dynamic> $DeviceListListToJson(DeviceListList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['deviceId'] = entity.deviceId;
  data['userId'] = entity.userId;
  data['deviceName'] = entity.deviceName;
  data['deviceBluetooth'] = entity.deviceBluetooth;
  data['deviceSerialnum'] = entity.deviceSerialnum;
  data['deviceImg'] = entity.deviceImg;
  data['connectStatus'] = entity.connectStatus;
  data['deviceLightRate'] = entity.deviceLightRate;
  data['groupName'] = entity.groupName;
  data['lockStatus'] = entity.lockStatus;
  data['sceneName'] = entity.sceneName;
  data['sceneLightRate'] = entity.sceneLightRate;
  data['groupId'] = entity.groupId;
  data['sceneId'] = entity.sceneId;
  data['isClose'] = entity.isClose;
  data['isNetDevice'] = entity.isNetDevice;
  return data;
}
